package cn.iocoder.yudao.module.pickbook.dal.mysql.voiceactors;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pickbook.dal.dataobject.voiceactors.VoiceActorsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pickbook.controller.admin.voiceactors.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 配音 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface VoiceActorsMapper extends BaseMapperX<VoiceActorsDO> {

    default PageResult<VoiceActorsDO> selectPage(VoiceActorsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VoiceActorsDO>()
                .eqIfPresent(VoiceActorsDO::getUserId, reqVO.getUserId())
                .eqIfPresent(VoiceActorsDO::getBookId, reqVO.getBookId())
                .orderByDesc(VoiceActorsDO::getId));
    }

    VoiceActorsDO selectByName(@Param("name") String name);

}